


def predict(sents, k=1):
    test = build_input([sents])
    # load训练好的模型
    _load_model()
    labels = model.predict_proba(test, k=k)[0]
    print(labels)
    result = []
    for label in labels:
        result.append({"label": label[0], 'domain': json.dumps(domain.get(label[0]), ensure_ascii=False)})
    return result